package com.ivo.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.ivo.model.Model;

@Entity
@org.hibernate.annotations.Entity(dynamicUpdate=true)
@Table (name = "SYS_D_LOG")
public class Log extends Model {

	private static final long serialVersionUID = -383782230437676348L;
	
	private Long logId;
	private String userId;
	private String logCateId;
	private MasterInstance masterIntance;
	private String message;
		
	public Log(){}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "LOG_ID")
	public Long getLogId() {
		return logId;
	}

	public void setLogId(Long logId) {
		this.logId = logId;
	}
	
	@Column(name = "USER_FK")
	public String getUserId() {
		return userId;
	}
	
	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "LOG_CATE_FK")
	public String getLogCateId() {
		return logCateId;
	}

	public void setLogCateId(String logCateId) {
		this.logCateId = logCateId;
	}
	
	@ManyToOne(cascade = {CascadeType.MERGE})
	@JoinColumn(name = "MAST_INS_FK", nullable = true)
	public MasterInstance getMasterIntance() {
		return masterIntance;
	}

	public void setMasterIntance(MasterInstance masterIntance) {
		this.masterIntance = masterIntance;
	}
	
	@Column(name = "MESSAGE")
	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	
}
